home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / OS2 / GNUSED.ZIP / patches.os2 < prev    next >
Encoding:
Text File  |  1996-02-10  |  4.4 KB  |  177 lines

  1. Only in new: README.OS2
  2. Only in new: patches.os2
  3. Only in new/sed: Makefile.os2
  4. Only in new/rx: Makefile.os2
  5. Only in new/rx: gnurx.def
  6. diff -cbr orig/rx/rxdbug.c new/rx/rxdbug.c
  7. *** orig/rx/rxdbug.c    Sun Dec 31 06:16:00 1995
  8. --- new/rx/rxdbug.c    Thu Feb 08 14:38:48 1996
  9. ***************
  10. *** 28,33 ****
  11. --- 28,35 ----
  12.   #include "rxall.h"
  13.   #include "rxgnucomp.h"
  14.   #include "rxnfa.h"
  15. + #include <stdio.h>
  16.   
  17.   
  18.   #ifdef __GNUC__
  19. diff -cbr orig/sed/sed.c new/sed/sed.c
  20. *** orig/sed/sed.c    Sun Dec 31 05:59:02 1995
  21. --- new/sed/sed.c    Sat Feb 10 19:48:22 1996
  22. ***************
  23. *** 395,400 ****
  24. --- 395,404 ----
  25.     rx_default_cache->bytes_allowed = 1048576 * 4;
  26.     rx_basic_unfaniverse_delay = 512 * 4;
  27.   
  28. + #ifdef __EMX__
  29. +   _response(&argc, &argv);
  30. +   _wildcard(&argc, &argv);
  31. + #endif
  32.   
  33.     myname = argv[0];
  34.     while ((opt = getopt_long (argc, argv, "hne:f:rV", longopts, (int *) 0))
  35. ***************
  36. *** 480,485 ****
  37. --- 484,494 ----
  38.     hold.text = ck_malloc (50);
  39.     hold.text[0] = '\n';
  40.   
  41. + #ifdef __EMX__
  42. +   _fsetmode(stdout, "b");
  43. +   setvbuf(stdout, NULL, _IOFBF, 65536);
  44. + #endif
  45.     if (argc <= optind)
  46.       {
  47.         last_input_file++;
  48. ***************
  49. *** 542,548 ****
  50. --- 551,576 ----
  51.     if (str[0] == '-' && str[1] == '\0')
  52.       prog_file = stdin;
  53.     else
  54. + #ifndef __EMX__
  55.       prog_file = ck_fopen (str, "r");
  56. + #else
  57. +   {
  58. +     char fname[256];
  59. +     _searchenv(str, "SEDPATH", fname);
  60. +     if ( fname[0] == 0 )
  61. +       _searchenv(str, "PATH", fname);
  62. +     if ( fname[0] == 0 )
  63. +       strcpy(fname,str);
  64. +     prog_file=ck_fopen(fname,"r");
  65. +   }
  66. +   if ( !isatty(fileno(prog_file)) )
  67. +   {
  68. +     char line[80];
  69. +     fgets(line, sizeof(line), prog_file);
  70. +     if ( strnicmp(line, "extproc ", 8) != 0 )
  71. +       rewind(prog_file);
  72. +   }
  73. + #endif
  74.     ch = getc (prog_file);
  75.     if (ch == '#')
  76.       {
  77. ***************
  78. *** 1254,1265 ****
  79.         if (!readit)
  80.       {
  81.         if (!file_ptrs[n].for_write)
  82. !         file_ptrs[n].for_write = ck_fopen (file_name, "w");
  83.       }
  84.         else
  85.       {
  86.         if (!file_ptrs[n].for_read)
  87. !         file_ptrs[n].for_read = fopen (file_name, "r");
  88.       }
  89.         flush_buffer (b);
  90.         return readit ? file_ptrs[n].for_read : file_ptrs[n].for_write;
  91. --- 1282,1293 ----
  92.         if (!readit)
  93.       {
  94.         if (!file_ptrs[n].for_write)
  95. !         file_ptrs[n].for_write = ck_fopen (file_name, "wb");
  96.       }
  97.         else
  98.       {
  99.         if (!file_ptrs[n].for_read)
  100. !         file_ptrs[n].for_read = fopen (file_name, "rb");
  101.       }
  102.         flush_buffer (b);
  103.         return readit ? file_ptrs[n].for_read : file_ptrs[n].for_write;
  104. ***************
  105. *** 1283,1293 ****
  106.         input_file = fopen (name, "r");
  107.         if (input_file == 0)
  108.       {
  109.         extern int errno;
  110.         extern char *sys_errlist[];
  111.         extern int sys_nerr;
  112. !       char *ptr;
  113.   
  114.         ptr = ((errno >= 0 && errno < sys_nerr)
  115.            ? sys_errlist[errno] : "Unknown error code");
  116. --- 1311,1322 ----
  117.         input_file = fopen (name, "r");
  118.         if (input_file == 0)
  119.       {
  120. + #ifndef __EMX__
  121.         extern int errno;
  122.         extern char *sys_errlist[];
  123.         extern int sys_nerr;
  124. ! #endif
  125. !       char const *ptr;
  126.   
  127.         ptr = ((errno >= 0 && errno < sys_nerr)
  128.            ? sys_errlist[errno] : "Unknown error code");
  129. ***************
  130. *** 1297,1302 ****
  131. --- 1326,1336 ----
  132.       }
  133.       }
  134.     
  135. + #ifdef __EMX__
  136. +   _fsetmode(input_file, "b");
  137. +   setvbuf(input_file, NULL, _IOFBF, 65536);
  138. + #endif
  139. +   
  140.     while (read_pattern_space ())
  141.       {
  142.         execute_program (the_program);
  143. ***************
  144. *** 1787,1792 ****
  145. --- 1821,1827 ----
  146.           if (!count)
  147.             break;
  148.           replaced = 1;
  149. +         if (remain + trail_nl_p > 0)
  150.             str_append (&tmp, line.text + start, remain + trail_nl_p);
  151.           t.text = line.text;
  152.           t.length = line.length;
  153. ***************
  154. *** 2058,2066 ****
  155.   usage (status)
  156.        int status;
  157.   {
  158. !   fprintf (status ? stderr : stdout, "\
  159.   Usage: %s [-nV] [--quiet] [--silent] [--version] [-e script]\n\
  160.           [-f script-file] [--expression=script] [--file=script-file] [file...]\n",
  161. !        myname);
  162.     exit (status);
  163.   }
  164. --- 2093,2101 ----
  165.   usage (status)
  166.        int status;
  167.   {
  168. !   fprintf (status ? stderr : stdout, "\n%s\n\n\
  169.   Usage: %s [-nV] [--quiet] [--silent] [--version] [-e script]\n\
  170.           [-f script-file] [--expression=script] [--file=script-file] [file...]\n",
  171. !        version_string, myname);
  172.     exit (status);
  173.   }
  174.